import axios from '../model/axios'

export const userLogin = (data: any) => {
  return axios({
    method: 'post',
    url: '/api/users/login',
    data
  })
}

export const userQuery = (params: any) => {
    return axios({
      method: 'get',
      url: '/api/users/query',
      headers:{
           token:window.localStorage.getItem("token")
      },
      params
    })
  }
export const userManageQuery = (params: any) => {
    return axios({
      method: 'get',
      url: '/api/users/userManageQuery',
      headers:{
           token:window.localStorage.getItem("token")
      },
      params
    })
  }

  export const userUpdate = (data: any) => {
    return axios({
      method: 'patch',
      url: '/api/users/update',
      headers:{
           token:window.localStorage.getItem("token")
      },
      data
    })
  }

  export const userAdd = (data: any) => {
    return axios({
      method: 'post',
      url: '/api/users/add',
      headers:{
        token:window.localStorage.getItem("token")
   },
      data
    })
  }
  export const userDel = (data: any) => {
    return axios({
      method: 'delete',
      url: '/api/users/del',
      data
    })
  }

export  const  userInsertMany = (data:any)=>{
  return  axios({
      method:"post",
      url:"/api/users/insertmany",
      headers:{
          token:window.localStorage.getItem("token")
      },
      data
  })
}
